package com.ruoyi.monitormanage.service.impl;

import java.util.List;

import com.ruoyi.common.core.constant.UserConstants;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.monitormanage.domain.TTestpointanddept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.monitormanage.mapper.TCreategpsMapper;
import com.ruoyi.monitormanage.domain.TCreategps;
import com.ruoyi.monitormanage.service.ITCreategpsService;

/**
 * 填入gpsService业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-10
 */
@Service
public class TCreategpsServiceImpl implements ITCreategpsService 
{
    @Autowired
    private TCreategpsMapper tCreategpsMapper;

    /**
     * 查询填入gps
     * 
     * @param id 填入gps主键
     * @return 填入gps
     */
    @Override
    public TCreategps selectTCreategpsById(Long id)
    {
        return tCreategpsMapper.selectTCreategpsById(id);
    }

    /**
     * 查询填入gps列表
     * 
     * @param tCreategps 填入gps
     * @return 填入gps
     */
    @Override
    public List<TCreategps> selectTCreategpsList(TCreategps tCreategps)
    {
        return tCreategpsMapper.selectTCreategpsList(tCreategps);
    }

    /**
     * 新增填入gps
     * 
     * @param tCreategps 填入gps
     * @return 结果
     */
    @Override
    public int insertTCreategps(TCreategps tCreategps)
    {
        return tCreategpsMapper.insertTCreategps(tCreategps);
    }

    @Override
    public boolean checkCreategpsUnique(TCreategps tCreategps) {
        //Long deptId = StringUtils.isNull(tCreategps.getId()) ? -1L : tCreategps.getId();
        TCreategps info = tCreategpsMapper.checkCreategpsUnique(tCreategps.getYear(), tCreategps.getDeptid());
        if (StringUtils.isNotNull(info))
        {
            return UserConstants.NOT_UNIQUE;
        }
        return UserConstants.UNIQUE;
    }

    /**
     * 修改填入gps
     * 
     * @param tCreategps 填入gps
     * @return 结果
     */
    @Override
    public int updateTCreategps(TCreategps tCreategps)
    {
        return tCreategpsMapper.updateTCreategps(tCreategps);
    }

    /**
     * 批量删除填入gps
     * 
     * @param ids 需要删除的填入gps主键
     * @return 结果
     */
    @Override
    public int deleteTCreategpsByIds(Long[] ids)
    {
        return tCreategpsMapper.deleteTCreategpsByIds(ids);
    }

    /**
     * 删除填入gps信息
     * 
     * @param id 填入gps主键
     * @return 结果
     */
    @Override
    public int deleteTCreategpsById(Long id)
    {
        return tCreategpsMapper.deleteTCreategpsById(id);
    }
}
